import java.util.Properties;
import java.util.Set;

/**
 * @ClassName: Demo02
 * @Description: TODO Property 的特有方法
 * @Author: MaykkStar@163.com
 */
public class Demo02 {
    public static void main(String[] args) {
        Properties prop = new Properties();

        // setProperty 用于键值对的添加
        prop.setProperty("001", "黄固");
        prop.setProperty("002", "段智兴");
        prop.setProperty("003", "欧阳锋");
        prop.setProperty("004", "洪七公");

        // stringPropertyNames 方法获取键的 Set 类型集合
        Set<String> keySet = prop.stringPropertyNames();
        for (String key : keySet) {
            System.out.println(key + "<==>" + prop.getProperty(key));
        }

    }
}
